<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <script src="dist/echarts.min.js"></script>

<body>

    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            overflow: hidden;

        }

        #main {
            width: 80%;
            height: 90%;
            background: rgba(0, 0, 0, 0);
        }
    </style>


    <div id="main"></div>

    <script type="text/javascript">

        var myChart = echarts.init(document.getElementById('main'));
        var option;
        myChart.showLoading({

            text: 'Wait Loading Chart',
            color: '#ff33cc',
            textColor: '#fff',
            maskColor: 'rgba(0,0,0,0)',
            zlevel: 5,

        });


        var ctype = 'bar';
        var valueType;
        var items = new Array();
        var values = new Array();
        var floatI100 = false;

        function SetValue() {

            ue.obj.setchartitem().then(function (ReturnValue) {
                items = ReturnValue;
            });

            ue.obj.setchartvalue().then(function (ReturnValue) {
                values = ReturnValue;
            });

            ue.obj.setcharttype().then(function (ReturnValue) {
                ctype = ReturnValue;
            });

            ue.obj.setchartvaluetype().then(function (ReturnValue) {
                valueType = ReturnValue;
            });


            ue.obj.setcharfloati100().then(function (ReturnValue) {
                floatI100 = ReturnValue;
            });

            if (floatI100) {

                for (let i = 0; i < values.length; i++) {
                    var ix = values[i] / 100;
                    values[i] = ix;
                }
            }
        }

        function SetOption() {
            // alert("Function returned : " + cname);

            option = {

                color: ['#92DD22'],
                tooltip: {},
                // 修改图表大小
                grid: {
                    left: '10%',
                    right: '0%',
                    top: '10%',
                    bottom: '10%',
                    containLabel: true
                },

                legend: {
                    data: [valueType]
                },
                xAxis: {
                    show: false,
                    type: 'value',
                    boundaryGap: [0, 0.01]
                },
                yAxis: {
                    type: 'category',
                    data: items,
                    axisLine:
                    {
                        show: false
                    },
                    axisTick:
                        { show: false, },
                    axisLabel: {
                        color: "#fff",
                    },
                },
                series: [{
                    //name: "",
                    type: 'bar',
                    data: values
                }
                ]
            };


        }

        setInterval(function () {
            SetValue();
            SetOption();

            myChart.setOption(option);
            myChart.hideLoading();

            window.addEventListener("resize", function () {
                myChart.resize();
            })


        }, 1000);


    </script>

</body>

</head>